<template>
	<view>
		<view class="list_box">
		  <view class="title">对方手机号</view>
		  <input class="text" placeholder="请输入对方手机号" v-model="name"></input>
		</view>
		<view class="entry-content">
			<view>转账数量</view>
			<view>
				￥
				<input type="number" style="font-size: 40rpx;" v-model="money" placeholder="请输入转账数量"/>
			</view>
			<view>可用{{str}}为 {{y}},转账手续费{{sx}}%</view>
		</view>
		
	

	
		
		
		
		  
		
		
		
		
		<button class="confirm" @tap="go()">提交</button>
		
		
		
	</view>
</template>

<script>
	
	export default {
	data() {
		return {
		all_y:0,
			name:'',
				money:'',
		y:0,
		sy:0,
		jcsy:0,
		sx:0,
		j:0,
		sx:0,
		str:'',
			type:0
		};
	},

	onLoad(e) {
		let me = this;
		me.type=e.type
		
	    
		me.Net._get('balance',{},(res)=>{
			if(res.code ==1){
				if(me.type==1)
				{
					me.y=res.data.j
					me.str='助农劵'
					me.sx=res.data.sxj
				}
				if(me.type==2)
				{
					me.y=res.data.b
						me.str='积分'
					me.sx=res.data.sxb
				}
			
				console.log(res.data)
			}
		});
	},
	methods: {
		
		go() {
			
			var that = this;	
			if(!that.name || !that.money )
			{
				that.Msg.Fail('请输入完整信息');
				return
			}
			
				that.Net._get('zz',{name:that.name,money:that.money,type:that.type},(res)=>{
					if(res.code ==1){
						that.Msg.Success(res.msg,(res)=>{
						uni.navigateBack()
						})
					}
				});
		},
	}
};
</script>


<style lang="scss">
	page{
		background-color: #f8f8f8;
		padding-top: 4%;
	}
	.entry-content {
		width: 690rpx;
		// height: 370rpx;
		background-color: #ffffff;
		box-shadow: 0 0 4rpx 2rpx #f6f6f6;
		border-radius: 20rpx;
		margin: 30rpx auto 0;
	
		view {
			font-size: 30rpx;
			font-weight: 500;
			width: 90%;
			margin: 0 auto;
	
			&:nth-child(1) {
				color: #666666;
				padding: 50rpx 0;
			}
	
			&:nth-child(2) {
				font-size: 60rpx;
				color: #1d1d1d;
				margin-top: 20rpx;
				padding: 30rpx 0;
				display: flex;
				align-items: center;
	
				input {
					font-size: 60rpx;
					color: #1d1d1d;
					margin-left: 30rpx;
				}
			}
	
			&:nth-child(3) {
				color: #767676;
				padding: 30rpx 0;
				border-top: 1px solid #f7f7f7;
			}
		}
	}
	.list_box{
	  width: 690rpx;
	  margin: 0 auto;
	  height: 60px;
	  background-color: #fff;
	  position: relative;
	  margin-bottom: 1px;
		background-color: #ffffff;
		box-shadow: 0 0 4rpx 2rpx #f6f6f6;
		border-radius: 20rpx;
		margin-top: 4%;
	}
	
	.list_box:nth-child(1){
	  margin-top: 10px;
	}
	
	.list_box .title{
	  font-size: 14px;
	  color: #333;
	  line-height: 60px;
	  position: absolute;
	  left: 26px;
	}
		
	
	.list_box .text{
	  height: 60px;
	  line-height: 60px;
	  font-size: 14px;
	  color: #666;
	  text-align: right;
	  position: absolute;
	  right: 26px;
	  width: 60%;
	}
	
	
	
	textarea{
	  width: 100%;
	  height: 100px;
	  padding: 10px;
	  font-size: 12px;
	  color: #333;
	  background-color: #fff;
	  text-indent: 16px;
	}
	
</style>
